import java.io.*;

public class Test1 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("D:\\test.txt");
        DataOutputStream dos=new DataOutputStream(fos);
        for (int i = 0; i < 6; i++) {
            dos.writeInt(i);
        }
        dos.close();

        FileInputStream fis=new FileInputStream("D:\\test.txt");
        DataInputStream dis=new DataInputStream(fis);
        for (int i = 0; i < 6; i++) {
            System.out.println(dis.readInt()+" ");
        }
        dis.close();
    }
}
